package com.example.providera.controller;

import com.example.providera.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

@RestController("/rabbit")
public class RabbitController {
    @Autowired
    RabbitService rabbitService;

    @GetMapping("send/{msg}")
    public void send(@PathVariable("msg")String msg) throws IOException, TimeoutException {
        rabbitService.send(msg);
    }
    @GetMapping("update/{msg}")
    public void sendDirect(@PathVariable("msg")String msg) throws IOException, TimeoutException {
        rabbitService.sendDirect(msg);
    }
}
